package cn.gjculture.shopping.api.dao;

import cn.gjculture.shopping.api.entity.OilCard;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface OilCardDao {

    @Select("select * from oilcard where phone=#{phone}")
    OilCard queryByPhone(String phone);

    @Insert("insert into oilcard(oilCardId,cardNo,customerId,phone,insertTime,updateTime,customerName,`status`) " +
            "values(#{oilCardId},#{cardNo},#{customerId},#{phone},#{insertTime},#{updateTime},#{customerName},#{status})")
    int insert(OilCard oilCard);

    @Select("select * from oilcard where cardNo=#{cardNo}")
    OilCard queryByCardNo(String cardNo);

    @Select("select * from oilcard")
    List<OilCard> query();

    @Delete("delete from oilcard where oilCardId=#{oilCardId}")
    int delete(String oilCardId);
}
